﻿//-----------------------------------------------------------------------
// <copyright file="WizardControlTemplate.cs" company="Microsoft Corporation">
//     Copyright (c) Microsoft Corporation 2011. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Internal.TeamFoundationServer.Submit
{
    using System.Windows.Forms;

    /// <summary>
    /// WizardControlTemplate class.
    /// </summary>
    internal class WizardControlTemplate : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="WizardControlTemplate"/> class.
        /// </summary>
        public WizardControlTemplate()
        {
            this.InitializeComponent();
        }

        /// <summary>
        /// ChangeContinueButtonEnabledHandler delegate.
        /// </summary>
        /// <param name="enabled">Continue.Enabled = Flag</param>
        public delegate void ChangeContinueButtonEnabledHandler(bool enabled);

        /// <summary>
        /// OpenControlHandler delegate.
        /// </summary>
        /// <param name="control">Control to open.</param>
        public delegate void OpenControlHandler(WizardControlTemplate control);

        /// <summary>
        /// GoHomeRequestedHandler delegate.
        /// </summary>
        /// <param name="action">Action to perform after navigate to control.</param>
        public delegate void GoHomeRequestedHandler(object action);

        /// <summary>
        /// ChangeContinueButtonEnabled event.
        /// </summary>
        public event ChangeContinueButtonEnabledHandler ChangeContinueButtonEnabled;

        /// <summary>
        /// OpenControl event.
        /// </summary>
        public event OpenControlHandler OpenControl;

        /// <summary>
        /// GoHomeRequested event.
        /// </summary>
        public event GoHomeRequestedHandler GoHomeRequested;

        /// <summary>
        /// Update window.
        /// </summary>
        /// <param name="title">Window Title.</param>
        /// <param name="description">Window Description.</param>
        /// <param name="backButtonEnabled">Back Button Enabled?</param>
        /// <param name="nextButtonEnabled">Next Button Enabled?</param>
        /// <param name="nextButtonCaption">Next Button Caption.</param>
        /// <param name="action">Action to perform on control.</param>
        public virtual void UpdateWindow(Label title, RichTextBox description, out bool backButtonEnabled, out bool nextButtonEnabled, out string nextButtonCaption, object action)
        {
            throw new System.NotImplementedException();
        }

        /// <summary>
        /// Button next method.
        /// </summary>
        public virtual void NextStep()
        {
            throw new System.NotImplementedException();
        }

        /// <summary>
        /// Fire ChangeContinueButtonEnabled event.
        /// </summary>
        /// <param name="enabled">Button next is Enabled?</param>
        protected void FireChangeContinueButtonEnabled(bool enabled)
        {
            if (this.ChangeContinueButtonEnabled != null)
            {
                this.ChangeContinueButtonEnabled(enabled);
            }
        }

        /// <summary>
        /// Fire OpenControl event.
        /// </summary>
        /// <param name="control">Control to open.</param>
        protected void FireOpenControl(WizardControlTemplate control)
        {
            if (this.OpenControl != null)
            {
                this.OpenControl(control);
            }
        }

        /// <summary>
        /// Fire GoHomeRequested event.
        /// </summary>
        /// <param name="action">Action to perform.</param>
        protected void FireGoHomeRequested(object action)
        {
            if (this.GoHomeRequested != null)
            {
                this.GoHomeRequested(action);
            }
        }

        /// <summary>
        /// Initialize Component.
        /// </summary>
        private void InitializeComponent()
        {
            var resources = new System.ComponentModel.ComponentResourceManager(typeof(WizardControlTemplate));
            this.SuspendLayout();

            // WizardControlTemplate
            this.MaximumSize = new System.Drawing.Size(990, 550);
            this.MinimumSize = new System.Drawing.Size(990, 500);
            this.Name = "WizardControlTemplate";
            resources.ApplyResources(this, "$this");
            this.ResumeLayout(false);
        }
    }
}
